<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>Title</title>
    <style>
        .one {
            width: 5px;
            margin: 0 auto;
            line-height: 30px;
            font-size: 10px;
            background-color: #ffffff;
            border: none;
        }

        body {
            font-family: SimSun;
        }

        td {
            word-wrap: break-word;
            word-break: break-all;
            font-family: SimSun;
            border:1px solid green;
            border-top-width:1px;
            border-right-width:1px;
            border-bottom-width:1px;
            border-left-width:1px;
        }

        table {
            border:none;
        }

        .overflow {
            width: 100%;
            text-overflow: ellipsis;
            position: relative;
            margin-right: -1000px;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
            word-break: break-all;
        }

        .tfooter1 {
            vertical-align: bottom; /*字体底部对齐*/
        }

        @page {
            /*size:A4 protrait;!*纵向打印*!*/
            size:A4 landscape;/*纵向打印*/
        }
    </style>
</head>
<body>
<#escape x as x?html>
    <div style="margin-top:0">
        <#assign size=10>
        <#if lines?exists>
            <#assign totalJf=0>   <#-- 总借方金额 -->
            <#assign totalDf=0>   <#-- 总贷方金额 -->
            
            <#-- 先计算总金额 -->
            <#list lines as line>
                <#if line.debitAmount?exists>
                    <#assign totalJf = totalJf + line.debitAmount>
                </#if>
                <#if line.creditAmount?exists>
                    <#assign totalDf = totalDf + line.creditAmount>
                </#if>
            </#list>
            
            <#assign page=(lines?size/size)?ceiling>
            <#list 1..page as c>
                <div <#if c !=page>style="page-break-after:always;"</#if>>
                    <table width="100%" cellspacing="0" cellpadding="0" style="font-size:12px;line-height:8px;border-collapse:collapse;">
                        <tbody>
                            <tr>
                                <td height="30" width="5%" style="text-align:center;color:green;font-weight:bold;">厂别</td>
                                <td height="30" width="26%" style="text-align:cneter;">${businessEntityCode!""}-${businessEntityName!""}</td>
                                <td height="30" width="22%" style="text-align:center;border-top:none;font-size:24px;font-weight:bold;">记账凭证</td>
                                <td height="30" width="10%" style="text-align:center;color:green;font-weight:bold;">入账日期</td>
                                <td height="30" width="13%" style="text-align:center;">
                                    <#if voucherDate??>
                                        <#if voucherDate?is_string>
                                            ${(voucherDate?split("-"))[0]}年${(voucherDate?split("-"))[1]}月${(voucherDate?split("-"))[2]}日
                                        <#else>
                                            ${((voucherDate?string('yyyy-MM-dd'))?split("-"))[0]}年${((voucherDate?string('yyyy-MM-dd'))?split("-"))[1]}月${((voucherDate?string('yyyy-MM-dd'))?split("-"))[2]}日
                                        </#if>
                                    </#if>
                                </td>
                                <td height="30" width="12%" style="text-align:center;color:green;font-weight:bold;">传票号码</td>
                                <td height="30" width="12%" style="text-align:center;">${custom.sys_type!""}${custom.dept_type!""}-${custom.book_no!""}-${custom.vouch_no!""}</td>
                            </tr>
                        </tbody>
                    </table>
                    <#if c*size gt lines?size>
                        <#assign end=lines?size-1 />
                    <#else>
                        <#assign end=c*size-1 />
                    </#if>
                    <br/>
                    <div width="100%">
                        <table width="100%" cellspacing="0" cellpadding="0" style="font-size:12px;text-align:center;border-collapse:collapse;">
                            <colgroup>
                                <col width="5%" />
                                <col width="13%" />
                                <col width="13%" />
                                <col width="7%" />
                                <col width="15%" />
                                <col width="23%" />
                                <col width="12%" />
                                <col width="12%" />
                            </colgroup>
                            <thead>
                                <tr>
                                    <td height="20" text-align="center" rowspan="2" style="color:green;font-weight:bold;border-top-width:2px;border-left-width:2px;border-right-width:1.5px;">流水号</td>
                                    <td height="20" text-align="center" style="color:green;font-weight:bold;border-top-width:2px;border-right-width:1.5px;">科目</td>
                                    <td height="20" text-align="center" style="color:green;font-weight:bold;border-top-width:2px;border-right-width:1.5px;">单位代号</td>
                                    <td height="20" text-align="center" style="color:green;font-weight:bold;border-top-width:2px;">相关日期</td>
                                    <td height="20" text-align="center" style="color:green;font-weight:bold;border-top-width:2px;border-right-width:1.5px;">相关号码</td>
                                    <td height="20" text-align="center" rowspan="2" style="color:green;font-weight:bold;border-top-width:2px;border-right-width:1.5px;">摘要</td>
                                    <td height="20" text-align="center" rowspan="2" style="color:green;font-weight:bold;border-top-width:2px;border-right-width:1.5px;">借方金额</td>
                                    <td height="20" text-align="center" rowspan="2" style="color:green;font-weight:bold;border-top-width:2px;border-right-width:2px;">贷方金额</td>
                                </tr>
                                <tr>
                                    <td height="20" text-align="center" style="color:green;font-weight:bold;border-right-width:1.5px;">子目</td>
                                    <td height="20" text-align="center" style="color:green;font-weight:bold;border-right-width:1.5px;">中心代号</td>
                                    <td height="20" text-align="center" colspan="2" style="color:green;font-weight:bold;border-right-width:1.5px;">对象别</td>
                                </tr>
                            </thead>
                            <tbody>
                            <#list (c-1) * size..end as i>
                                <#assign line=lines[i] />
                                <tr>
                                    <td height="25" style="text-align:center;border-top-width:1.5px;border-left-width:2px;border-right-width:1.5px;" rowspan="2">${line.entrySequenceNo!""}</td>
                                    <td height="25" style="text-align:left;border-top-width:1.5px;border-right-width:1.5px;">${line.subjectCode!""}-${line.subjectName!""}</td>
                                    <td height="25" style="text-align:left;border-top-width:1.5px;border-right-width:1.5px;">${line.custom.bel_branch!""}-${line.custom.bel_branch_name!""}</td>
                                    <td height="25" style="text-align:left;border-top-width:1.5px;">${line.custom.rel_date!""}</td>
                                    <td height="25" style="text-align:left;border-top-width:1.5px;border-right-width:1.5px;">${line.custom.rel_no!""}</td>
                                    <td height="25" style="text-align:left;border-top-width:1.5px;border-right-width:1.5px;" rowspan="2">${line.voucherAbstract!""}</td>
                                    <td height="25" style="text-align:right;border-top-width:1.5px;border-right-width:1.5px;" rowspan="2">${line.debitAmount!""}</td>
                                    <td height="25" style="text-align:right;border-top-width:1.5px;border-right-width:2px;" rowspan="2">${line.creditAmount!""}</td>
                                </tr>
                                <tr>
                                    <td height="25" style="text-align:left;border-right-width:1.5px;">${line.custom.sub_code!""}-${line.custom.sub_name!""}</td>
                                    <td height="25" style="text-align:left;border-right-width:1.5px;">${line.custom.detc_code!""}-${line.custom.detc_name!""}</td>
                                    <td height="25" style="text-align:left;border-right-width:1.5px;" colspan="2">${line.custom.object_no!""}-${line.custom.object_name!""}</td>
                                </tr>
                            </#list>
                            <tr>
                                <td colspan="5" rowspan="2" height="50" style="text-align:left;border-bottom-width:0px;border-left-width:0px;border-top-width:2px;border-right-width:2px;">
                                    &nbsp;&nbsp;<b><span style="color:green">过账人:</span></b>${operator!"-"}<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:green">审核人:</span></b>${reviewer!"-"}<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:green">录入人:</span></b>${preparedBy!"-"}
                                </td>
                                <td height="25" style="text-align:center;border-right-width:1.5px;border-top-width:1.5px;border-bottom-width:1.5px;">合计</td>
                                <td height="25" style="text-align:right;border-right-width:1.5px;border-top-width:1.5px;border-bottom-width:1.5px;">
                                    <#if c == page>
                                        ${totalJf!""}
                                    </#if>
                                </td>
                                <td height="25" style="text-align:right;border-top-width:1.5px;border-right-width:2px;border-bottom-width:1.5px;">
                                    <#if c == page>
                                        ${totalDf!""}
                                    </#if>
                                </td>
                            </tr>
                            <tr>
                                <td height="25" style="text-align:center;border-right-width:1.5px;border-bottom-width:2px;">页次</td>
                                <td height="25" style="text-align:center;border-right-width:2px;border-bottom-width:2px;" colspan="2">第${c}页,共${page}页</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </#list>
        </#if>
    </div>
</#escape>
</body>
</html>